Readers can search for articles across the entire site using the search page atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/santiagodc8/tu_perfil.net/llms.txt
Use this file to discover all available pages before exploring further.
/buscar.
URL
/buscar with no query shows an empty search form with no results.
Examples:
/buscar?q=elecciones— search for “elecciones” across all categories/buscar?q=hospital&cat=perfil-salud&sort=popular— search in Perfil Salud, sorted by most read
Search behavior
Search is performed entirely on the server (no client-side fetch). The page is a Next.js server component that readssearchParams and runs a Supabase query on each request.
The query matches against three fields using case-insensitive ilike:
src/app/(public)/buscar/page.tsx
Search matches on
title, excerpt, and content (the full article body). Results are limited to 30 articles per search.Filters and sort
After the search box, two dropdown filters let the reader narrow results:Category filter
A
<select> populated with all categories from the database. Selecting a category adds cat={slug} to the query and restricts results to articles in that category.Sort order
Three sort options: Más recientes (
recent, default), Más antiguas (oldest), and Más leídas (popular). Sorting by popular orders by the views column descending.src/app/(public)/buscar/page.tsx
Results display
When a query is present and results are found, the page shows:- A result count summary: e.g., “5 resultados para “elecciones” en Perfil Político”
- A responsive 3-column article card grid (
ArticleCardcomponent), matching the same card style used on category and tag pages.
src/app/(public)/buscar/page.tsx
Empty state
Two distinct empty states are handled:| Condition | What the reader sees |
|---|---|
| No query entered | The form is shown; no result count or grid is rendered. |
| Query entered, zero results | ”No se encontraron noticias para esta búsqueda.” is shown below the filters. |
src/app/(public)/buscar/page.tsx
Search box in the sidebar
A compact search box also appears in theSidebarPublic component on the home page. It submits to the same /buscar endpoint:
src/components/public/SidebarPublic.tsx
